package com.tientui.app;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;

public class MainActivity extends Activity {
	private AppController mController;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        mController = new AppController(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
            case R.id.menu_home:
                mController.loadUrl(AppConfig.URL_HOME);
                return true;
                
            case R.id.menu_reload:
                mController.reload();
                return true;
                
            case R.id.menu_lstk:
            	mController.loadUrl(AppConfig.URL_LSTK);
            	return true;
            	
            	
            case R.id.menu_lsv:
            	mController.loadUrl(AppConfig.URL_LSV);
            	return true;
            	
            default:
                return super.onOptionsItemSelected(item);
        }
    }
}
